package com.example.blog.common;

public class R {
    public int code;
    public String message;
    public Object data;

    public R(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static R success(Object data) {
        return new R(200, "success", data);
    }

    public static R fail(String message) {
        return new R(500, message, null);
    }


    public static R fail() {
        return new R(500, "", null);
    }

    public static R success() {
        return success(null);
    }
}
